home *** CD-ROM | disk | FTP | other *** search
- /*SwapVolume is part of shell Written by and property of: Eric J. Hayes*/
- /*non-profit use of this library must be accompanyed by a credit to myself.*/
- /*sale of all or any part of this library or it's headers prohibited without*/
- /*written permission of myself*/
- /* ®1987-1991 Eric J. Hayes*/
-
-
- #pragma mark PROTOS
- OSErr SwapVolume(short,long,short*,long*);
-
-
-
- OSErr SwapVolume(inVRefNum,inDirID,outVRefNum,outDirID)
- short inVRefNum;
- long inDirID;
- short *outVRefNum;
- long *outDirID;
- {
- OSErr err;
- ParmBlkPtr pb;
-
- pb = (ParmBlkPtr)NewPtrClear(sizeof(WDPBRec));
-
- if ( pb != nil )
- {
- ((WDPBPtr)pb)->ioCompletion = nil;
- err = PBHGetVol((WDPBPtr)pb,FALSE);
-
- if ( err == noErr )
- {
- *outVRefNum = ((WDPBPtr)pb)->ioVRefNum;
- *outDirID = ((WDPBPtr)pb)->ioWDDirID;
-
- ((WDPBPtr)pb)->ioCompletion = nil;
- ((WDPBPtr)pb)->ioNamePtr = nil;
- ((WDPBPtr)pb)->ioVRefNum = inVRefNum;
- ((WDPBPtr)pb)->ioWDProcID = nil;
- ((WDPBPtr)pb)->ioWDVRefNum = nil;
- ((WDPBPtr)pb)->ioWDDirID = inDirID;
-
- err = PBHSetVol((WDPBPtr)pb,FALSE);
- }
-
- DisposPtr((Ptr)pb);
- }
-
- return(err);
- }
-